Skip to content

feat(gnovm): Rewrite AST prior go type checking to avoid inter-realm type check errors. #4156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 20, 2025

Conversation

mvertes
Copy link
Contributor

@mvertes mvertes commented Apr 15, 2025

No description provided.

@Gno2D2
Copy link
Collaborator

Gno2D2 commented Apr 15, 2025

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check)
Read More

🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.

✅ Automated Checks (for Contributors):

No automated checks match this pull request.

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission

@mvertes mvertes marked this pull request as ready for review April 15, 2025 12:21
@leohhhn leohhhn self-requested a review April 15, 2025 13:01
@Kouteki Kouteki moved this from Triage to In Review in 🧙‍♂️gno.land core team Apr 16, 2025
@Kouteki Kouteki requested review from ltzmaxwell and thehowl April 16, 2025 08:21
Comment on lines 198 to 212
if len(n.Args) > 0 {
a = n.Args[0]
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: len of n.Args can only be 1, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I should probably validate the syntax of cross() and crossing() while they are still available for check!

Comment on lines +265 to +270

// Validate Gno syntax and type check.
if err := gno.TypeCheckMemPackageTest(memPkg, m.Store); err != nil {
return runResult{Error: err.Error()}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my understanding, this is a signal that we’re no longer adding new features to the gno type checker, right?
Do we already have a clear clarification on this plan?

I think what we need to do is review the existing issues related to the gno type checker—either mark them appropriately or close them.
There are also some related PRs, such as #4033. Should we go ahead and merge them? @thehowl @mvertes

Copy link
Member

@thehowl thehowl Apr 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what jae said, we should go through the PRs and issues relating to the type-checker and label them. I think we can close them for now, then recover them if we want to go ahead and improve our own preprocessor / type checker.

Longer term, I hope that we can migrate away from the GnoVM sooner than we consider removing our reliance on the go type checlker.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's going to take a long time to remove the go type checker. At least we should keep it around for fuzz testing against our own, with fuzz tools that can generate any valid code to run against both go and gno.

Copy link
Contributor

@ltzmaxwell ltzmaxwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me.

Base automatically changed from heapitems_for_3693 to master April 20, 2025 11:17
@jaekwon jaekwon force-pushed the gno-4060-typecheck branch from d0b79f5 to 3b5ac5b Compare April 20, 2025 20:39
@jaekwon jaekwon changed the title Rewrite AST prior go type checking to avoid inter-realm type check errors. feat(gnovm): Rewrite AST prior go type checking to avoid inter-realm type check errors. Apr 20, 2025
@jaekwon jaekwon merged commit 60a1d92 into master Apr 20, 2025
15 of 24 checks passed
@jaekwon jaekwon deleted the gno-4060-typecheck branch April 20, 2025 20:40
@github-project-automation github-project-automation bot moved this from In Progress to Done in 💪 Bounties & Worx Apr 20, 2025
@jaekwon jaekwon restored the gno-4060-typecheck branch April 20, 2025 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🤖 gnovm Issues or PRs gnovm related
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants